<?php session_start(); 
/*
Script Name: Registration form in php with validation
Script URI: http://allitstuff.com/?p=962
Website URI: http://allitstuff.com/
*/
?>
<html>
	<head>
		<style type="text/css">
			.td{
						border-bottom:1px #a1a1a1 solid;
					}
			.input{
					border:1px #a1a1a1 solid;
					border-radius:5px;
					height:30px;
					width:200px;
			}
		</style>
	</head>
	<body>
	
<form action="register_pro.php" method="post">
	<a href="http://www.allitstuff.com">allitstuff.com</a>
<table  height="450px" width="600px" style="border-top:1px black solid;border-bottom:1px black solid;" cellspacing="0">
	<tr>
		<th colspan=2 style="border-bottom:1px black solid;padding-top:10px;padding-bottom:10px">Registration Form</th>
		<tr>
		<td>
			<?php
			if(isset($_SESSION['reg']))
			{
				
				$name=$_SESSION['data']['name'];
				$u_name=$_SESSION['data']['u_name'];
				$phone=$_SESSION['data']['phone'];
				$email=$_SESSION['data']['email'];
				
			}
			
		?>
		<?php if(isset($_SESSION['reg']['done']))
				echo '<font color="green" style="margin-left:10px">'.$_SESSION['reg']['done'].'</font>';
		?>
		</td>
		</tr>
	</tr>
	<tr>
		<td class="td">Name :-</td>
		<td class="td"><input type="text" name="name" class="input" value="<?php echo $name ?>">
		<?php if(isset($_SESSION['reg']['name']))
				echo '<font color="red" style="margin-left:10px">'.$_SESSION['reg']['name'].'</font>';
		?></td>
	</tr>
	<tr>
		<td class="td">Username :-</td>
		<td class="td"><input type="text" name="u_name" class="input" value="<?php echo $u_name ?>">
		<?php if(isset($_SESSION['reg']['u_name']))
				echo '<font color="red" style="margin-left:10px">'.$_SESSION['reg']['u_name'].'</font>';
		?></td>
	</tr>
	<tr>
		<td class="td">Email :-</td>
		<td class="td"><input type="text" name="email" class="input" value="<?php echo $email ?>">
		<?php if(isset($_SESSION['reg']['email']))
				echo '<font color="red" style="margin-left:10px">'.$_SESSION['reg']['email'].'</font>';
		?></td>
	</tr>
	<tr>
		<td class="td">Gender :-</td>
		<td class="td"><input type="radio" value="male" name="gender">Male
			<input type="radio" value="female" style="border-bottom:1px #a1a1a1 solid" name="gender">Female
			<?php if(isset($_SESSION['reg']['gender']))
				echo '<font color="red" style="margin-left:10px">'.$_SESSION['reg']['gender'].'</font>';
		?>
		</td>
	</tr>
	<tr>
		<td class="td">Phone No. :-</td>
		<td class="td"><input type="text" name="phone" class="input" maxlength="10" value="<?php echo $phone ?>">
		<?php if(isset($_SESSION['reg']['phone']))
				echo '<font color="red" style="margin-left:10px">'.$_SESSION['reg']['phone'].'</font>';
		?></td>
	</tr>
	<tr>
		<td class="td">Password :-</td>
		<td class="td"><input type="password" class="input" name="pass">
		<?php if(isset($_SESSION['reg']['pass']))
				echo '<font color="red" style="margin-left:10px">'.$_SESSION['reg']['pass'].'</font>';
		?></td>
	</tr>
	<tr>
		<td class="td">Conform-Password :-</td>
		<td class="td"><input type="password" class="input" name="c_pass">
		<?php if(isset($_SESSION['reg']['c_pass']))
				echo '<font color="red" style="margin-left:10px">'.$_SESSION['reg']['c_pass'].'</font>';
		?></td>
	</tr>
	<th colspan="2"><input type="submit" style="height:35px;width:120px" value="Submit"></th>
		<?php unset($_SESSION['reg']); ?>
</table>
</form>
	</body>
</html>